# 继承演示
class Person:
    def __init__(self, name, gender):
        self.name = name
        self.gender = gender

    def show(self):
        print("名字:", self.name, "性别:", self.gender, end="\t")


class Student(Person):
    def __init__(self, name, gender, number):
        super().__init__(name, gender)
        self.number = number

    def show(self):
        # 调用父类的部分实现，并自己实现一部分。
        super().show()
        print(f"我的学号是:{self.number}")


class Doctor(Person):
    def __init__(self, name, gender, department):
        super().__init__(name, gender)
        self.department = department

    def show(self):
        # super().show()
        # print(f"部门: {self.department}")
        # 不是用父类的定义，全部自己重写
        print(f"我的名字叫{self.name},性别{self.gender},所属部门{self.department}")


stu = Student("李磊", "男", "0001")
stu.show()
print()
doctor = Doctor("张三", "女", "内科")
doctor.show()
